//package com.dq.controller.op.opmerchant;
//
//import com.dq.annotation.aop.DataFilter;
//import com.dq.exception.customException.AdminException;
//import com.dq.controller.in.base.BaseAdminQuery;
//import com.dq.controller.op.opmerchant.in.query.AccountQuery;
//import com.dq.vo.Vo;
//import com.dq.vo.baseVo.VO;
//import com.dq.domain.sys.user.Account;
//import com.dq.service.AllService;
//import com.github.pagehelper.PageHelper;
//import com.github.pagehelper.PageInfo;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.apache.commons.lang3.StringUtils;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.List;
//import java.util.Map;
//
///**
// * @author heshuaijun
// * @date 2019/9/1820:56
// */
//@Api(description = "后台会员账户记录管理")
//@RestController
//@RequestMapping("/sys/account")
//public class AccountController extends AllService {
//
//    @ApiOperation("根据条件检索所有会员账户列表")
//    @PostMapping("/list")
//    @RequiresPermissions("sys:account:list")
//    @DataFilter(deptAlias = "org")
//    public Vo list(@RequestBody AccountQuery accountQuery) throws AdminException {
//        accountQuery.format();
//        Map<String, Object> query = accountQuery.parseMap();
//        if (StringUtils.isNotBlank(accountQuery.getCaseUserMobile())) {
//            query.put("caseUser_mobile", accountQuery.getCaseUserMobile());
//            query.remove("caseUserMobile");
//        }
//        if (StringUtils.isNotBlank(accountQuery.getCaseUserMobile())) {
//            query.put("caseUser_likelocalNickName", BaseAdminQuery.likeSql(accountQuery.getCaseUserLocalNickName()));
//            query.remove("caseUserLocalNickName");
//        }
//        if (StringUtils.isNotBlank(accountQuery.getLocalNickName())) {
//            query.put("user_likelocalNickName", BaseAdminQuery.likeSql(accountQuery.getLocalNickName()));
//            query.remove("localNickName");
//        }
//        if (StringUtils.isNotBlank(accountQuery.getMobile())) {
//            query.put("user_mobile", accountQuery.getMobile());
//            query.remove("mobile");
//        }
//        if (StringUtils.isNotBlank(accountQuery.getOrgName())) {
//            query.put("org_name", accountQuery.getOrgName());
//            query.remove("orgName");
//        }
//        List<Account> accountList = dao.find(dao.queryAdminHql(Account.class, query), query);
//        PageHelper.startPage(accountQuery.getPage(), accountQuery.getSize());
//        PageInfo pageInfo = new PageInfo((List<Account.Vo>) VO.toVOCollection(accountList));
//        pageInfo.setTotal(dao.count(dao.countAdminHql(Account.class, query), query));
//        return new Vo(pageInfo);
//    }
//}
